#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
##    Copyright (C) 2005 manatlan manatlan[at]gmail(dot)com
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 2 only.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##

import optparse
import sys
import os

if os.path.basename(__file__)=="fricorder":
    sys.path.append(os.path.join( os.path.dirname(__file__), "../lib/fricorder"))

from fricorder import FConfig

USAGE="""%s [Options]
Fricorder %s by manatlan. License GPL-2
Programme permettant l'enregistrement differe de flux freebox dans le cadre du multiposte de free.""" % (sys.argv[0],FConfig.VERSION)

if __name__ == "__main__":
    parser = optparse.OptionParser(usage=USAGE, version=("fricorder "+FConfig.VERSION))
    parser.add_option("-w","--web",action="store_true",dest="web",
                        help="Lance l'interface web de fricorder, il est alors possible de rajouter un numero de port")

    (options, args) = parser.parse_args()

    if options.web:
        from fricorder.fricorderweb import main
        sys.argv[1]=args and args[0] or "8080"
    else:
        from fricorder.fricordergtk import main

    main()

